OPC Studio User's Guide and Reference
Installed Examples - Console - ConsoleApplication1

The simplest console application. Reads and displays an OPC item value in a console.

The main program:

// $Header: $
// Copyright (c) CODE Consulting and Development, s.r.o., Plzen. All rights reserved.

// ConsoleApplication1.cpp : main project file.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

#include "stdafx.h"

using namespace OpcLabs::EasyOpc::DataAccess;
using namespace System;

int main(array<System::String ^> ^args)
{
    EasyDAClient^ client = gcnew EasyDAClient();
    Console::WriteLine("Reading item...");
    // ReadItemValue is an extension method on the IEasyDAClient interface; need to call it explicitly in C++/CLR.
    Console::WriteLine(IEasyDAClientExtension::ReadItemValue(client, "", "OPCLabs.KitServer.2", "Demo.Ramp"));
    Console::WriteLine("Press Enter to continue...");
    Console::ReadLine();
    return 0;
}

 

See Also

Conceptual

_Installed Examples (Excluded)

Installed Examples - WindowsForms

Installed Examples - WPF